import request from '@/config/axios'

export interface OutboundOrderFormVO {
  id: number
  requisitionForm: string
  dictOutsourceMode: byte
  productNumber: string
  partNumber: string
  partName: string
  drawingNumber: string
  partSpecification: string
  material: string
  specification: string
  netSizeLength: number
  netSizeWidth: number
  cuttingSizeLength: number
  cuttingSizeWidth: number
  planQuantity: number
  partUnit: string
  dictProcessName: number
  dictTypeOfWork: number
  dictBaitingType: number
  dictIsMachine: number
  dictMachiningProcess: number
  requirementTime: Date
  creatorName: string
  updaterName: string
  orderNumber: string
  supplierName: string
  salesName: string
  purchaseQuantity: number
  remark: string
  dictOutsourceStatus: number
  salesCode: string
  itaxrate: number
  taxIncludedPrice: number
  priceTaxTotal: number
  priceExcludingTax: number
  taxRelief: number
  unitPrice: number
  planArriveTime: localdate
  orderDate: localdate
  affiliatedFunction: string
  cvenpuomprotocol: string
  protocolName: string
}

// 查询外协管理 -- 外协订单 -- 外协订单列表
export const getOutboundOrderFormPage = async (params) => {
  return await request.get({ url: `/outsource/outbound-order-form/page`, params })
}

// 查询外协管理 -- 外协订单 -- 外协订单详情
export const getOutboundOrderForm = async (id: number) => {
  return await request.get({ url: `/outsource/outbound-order-form/get/order?orderNumber=` + id })
}

// 行关闭or取消订单外协管理 -- 外协订单 -- 外协订单
export const updateOutboundOrderForm = async (id: number[]) => {
  return await request.get({ url: `/outsource/outbound-order-form/down?ids=` + id  })
}

// 提交订单外协管理 -- 外协订单 -- 外协订单
export const submitOutboundOrderForm = async (data) => {
  return await request.post({ url: `/outsource/outbound-order-form/saveOrSubmit`, data  })
}

// 导出外协管理 -- 外协订单 -- 外协订单 Excel
export const exportOutboundOrderForm = async (data) => {
  return await request.download({ url: `/outsource/outbound-order-form/export-excel`, data })
}
